package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.RestShopFallBack;
import cn.cs.fallback.UserBalanceFallBack;
import cn.cs.pojo.AccountDetail;
import cn.cs.pojo.Shop;
import cn.cs.pojo.UserBalance;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = UserBalanceFallBack.class)
public interface UserBalanceClient {


    //根据用户id 查询账户余额
    @RequestMapping(value = "/getUserBalanceById", method = RequestMethod.POST)
    public UserBalance getUserBalanceById(@RequestParam("userId") String userId)throws Exception;
    //账户充值业务
    @RequestMapping(value = "/updateBalance", method = RequestMethod.POST)
    public Integer updateBalance(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getUserBalanceListByMap", method = RequestMethod.POST)
    public List<Map<String,Object>>	getUserBalanceListByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/getUserBalanceCountByMap", method = RequestMethod.POST)
    public Integer getUserBalanceCountByMap(@RequestBody Map<String, Object> param)throws Exception;

    @RequestMapping(value = "/addUserBalance", method = RequestMethod.POST)
    public Integer addUserBalance(@RequestBody UserBalance userBalance)throws Exception;

    @RequestMapping(value = "/modifyUserBalance", method = RequestMethod.POST)
    public Integer modifyUserBalance(@RequestParam("balance") String balance, @RequestParam("id") String id)throws Exception;

    @RequestMapping(value = "/deleteUserBalanceById", method = RequestMethod.POST)
    public Integer deleteUserBalanceById(@RequestParam("id") Long id)throws Exception;

    @RequestMapping(value = "/updateUserBalanceNew", method = RequestMethod.POST)
    public Integer updateUserBalanceNew(@RequestParam("id") String id, @RequestParam("balance") String balance)throws Exception;

}

